import { defineStore } from "pinia";
import { ref } from "vue";

export const useUserStore = defineStore('user',()=>{

    const user = ref({});

    const setUserInfo = (newToken)=>{
        user.value = newToken;
    }

    const removeUserInfo = ()=> {
        user.value = {}
    }

    return {
        user,setUserInfo,removeUserInfo
    }
},{
    persist: true //持久化存储
});